home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- global proc polySelectBorderShell(int $borderOnly)
- //
- // Description:
- // Select either a shell or border based on
- // the current component selection
- // Arguments:
- // borderOnly
- // Returns:
- //
- //
- {
- string $compSel[];
-
- // Process all the subdiv components first
- string $subdComps[];
-
- if (`isTrue "SubdivUIExists"`) {
-
- $subdComps = `subdListComponentConversion -fv -ff -fuv -fe -tuv`;
-
- // Process only one subd component type: UVs, Faces, edges
- $subdComps = `filterExpand -sm 73 $subdComps`;
- if (size($subdComps)) {
-
- // Convert selected subd uvs to shell uvs or border
- if( $borderOnly ) {
- $subdComps = `subdListComponentConversion -fuv -tuv -uvb $subdComps`;
- } else {
- $subdComps = `subdListComponentConversion -fuv -tuv -uvs $subdComps`;
- }
- }
- } // if SubdivUIExists
-
- // Turn on shell mode for current selection.
- polySelectConstraint -t 0;
- polySelectConstraint -sh 1 -m 2;
-
- // If want borders filter AFTER getting the entire shell
- if ($borderOnly)
- {
- // // Only do one type. Order of testing is: UVs, Vtx, Face, Edge
- // uv
- $compSel = `filterExpand -sm 35`;
- if (size($compSel))
- {
- polySelectConstraint -w 1 -t 0x0010 -m 2;
- polySelectConstraint -w 0 -t 0x0010 -m 0;
- }
- else
- {
- // Vertex
- $compSel = `filterExpand -sm 31`;
- if (size($compSel))
- {
- polySelectConstraint -w 1 -t 0x0001 -m 2;
- polySelectConstraint -w 0 -t 0x0001 -m 0;
- }
- else
- {
- // edge
- $compSel = `filterExpand -sm 32`;
- if (size($compSel))
- {
- polySelectConstraint -w 1 -t 0x8000 -m 2;
- polySelectConstraint -w 0 -t 0x8000 -m 0;
- }
- else
- {
- // face
- $compSel = `filterExpand -sm 34`;
- if (size($compSel))
- {
- polySelectConstraint -w 1 -t 0x0008 -m 2;
- polySelectConstraint -w 0 -t 0x0008 -m 0;
- }
- }
- }
- }
- }
-
- // Reset shell constraint
- polySelectConstraint -sh 0 -m 0;
-
- // Add to the selection list the subd components
- if( size($subdComps) > 0 ) {
- select -add $subdComps;
- }
- }
-